CREATE TABLE [dbo].[BorrowReturn]
(
[Id] [int] NOT NULL,
[ReaderId] [int] NULL,
[BookItemId] [int] NULL,
[Status] [int] NULL,
[FromDate] [date] NULL,
[BorrowEmployeeId] [int] NULL,
[ReturnDate] [date] NULL,
[Note] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ReturnEmployeeId] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[BorrowReturn] ADD CONSTRAINT [PK_BorrowReturn] PRIMARY KEY CLUSTERED  ([Id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BorrowReturn] ADD CONSTRAINT [FK_BorrowReturn_BookItem] FOREIGN KEY ([BookItemId]) REFERENCES [dbo].[BookItem] ([Id])
GO
ALTER TABLE [dbo].[BorrowReturn] ADD CONSTRAINT [FK_BorrowReturn_Employee] FOREIGN KEY ([BorrowEmployeeId]) REFERENCES [dbo].[Employee] ([Id])
GO
ALTER TABLE [dbo].[BorrowReturn] ADD CONSTRAINT [FK_BorrowReturn_Reader] FOREIGN KEY ([ReaderId]) REFERENCES [dbo].[Reader] ([Id])
GO
ALTER TABLE [dbo].[BorrowReturn] ADD CONSTRAINT [FK_BorrowReturn_Employee1] FOREIGN KEY ([ReturnEmployeeId]) REFERENCES [dbo].[Employee] ([Id])
GO
